package com.entity;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanPostProcessor;
import org.springframework.stereotype.Component;

//@Component
public class CarBeanPostProcessor implements BeanPostProcessor {
    public Object postProcessBeforeInitialization(Object o, String s) throws BeansException {
        if(o instanceof Car){
            System.out.println("....car BeanPostProcessor postProcessBeforeInitialization.....invoke");
        }
//        System.out.println("bean before:" + o);
        return o;
    }

    public Object postProcessAfterInitialization(Object o, String s) throws BeansException {
        if(o instanceof Car){
            System.out.println("....car BeanPostProcessor postProcessAfterInitialization.....invoke");
        }
//        System.out.println("bean after:" + o);
        return o;
    }
}
